Merge pull request #73 from romoloman/master
[openXsensor.git] / oXs_Configurator / Python 37 Sources / oxsSequence.py
bloba5792fa177ca0d2874987a3ca0c42fa441cb0faf
1 from oxsConfig import ttk, W , E , fSequence, SeqUnitVar, SeqOut6Var, SeqOut5Var, SeqOut4Var, SeqOut3Var, SeqOut2Var, SeqOut1Var
2 from oxsConfig import SeqB5Var, SeqB4Var, SeqB3Var, SeqB2Var, SeqB1Var, SeqB0Var, SeqTVar, SeqMinVoltVar, SeqMinCellVar
5 #//#define SEQUENCE_OUTPUTS 0b100000
6 ##define SEQUENCE_UNIT 2
7 ##define SEQUENCE_m100 1 , 0b100000 , 3 , 0b000000 , 1 , 0b100000 , 3 , 0b000000
8 #//#define SEQUENCE_m75 1 , 0b100000 , 1 , 0b000000 , 2 , 0b100000 , 2 , 0b000000
9 #//#define SEQUENCE_m50 5 , 0b100000 , 5 , 0b000000
10 #//#define SEQUENCE_m25 5 , 0b100000 , 5 , 0b000000 , 0 , 0b100000
11 ##define SEQUENCE_0 3 , 0b100000 , 1 , 0b000000
12 #//#define SEQUENCE_25 2 , 0b100000 , 2 , 0b000000
13 #//#define SEQUENCE_50 5 , 0b100000 , 5 , 0b000000
14 #//#define SEQUENCE_75 7 , 0b100000 , 7 , 0b000000
15 ##define SEQUENCE_100 8 , 0b100000 , 16 , 0b000000 , 24 , 0b100000 , 32 , 0b000000
16 #//#define SEQUENCE_LOW 10 , 0b100000 ,10 , 0b000000 // sequence for Low voltage
17 #//#define SEQUENCE_MIN_VOLT_6 4000 // sequence_100 will be activated if voltage 6 is lower that the value.
18 #//#define SEQUENCE_MIN_CELL 3000 // sequence_100 will be activated if lowest cell is lower that the value.
21 ttk.Label(fSequence, text="Seq. Unit" ).grid(column= 0, row=3, padx= 1 , pady= 1, columnspan=2, sticky=(W))
22 ttk.Entry(fSequence, textvariable=SeqUnitVar , width='15', justify='right').grid(column=2 , row=3, columnspan=6, sticky=(E))
23 ttk.Label(fSequence, text="D13" ).grid(column= 2, row=4, padx= 0 , pady= 1, sticky=(W))
24 ttk.Label(fSequence, text="D12" ).grid(column= 3, row=4, padx= 0 , pady= 1, sticky=(W))
25 ttk.Label(fSequence, text="D11" ).grid(column= 4, row=4, padx= 0 , pady= 1, sticky=(W))
26 ttk.Label(fSequence, text="D10" ).grid(column= 5, row=4, padx= 0 , pady= 1, sticky=(W))
27 ttk.Label(fSequence, text="D09" ).grid(column= 6, row=4, padx= 0 , pady= 1, sticky=(W))
28 ttk.Label(fSequence, text="D08" ).grid(column= 7, row=4, padx= 0 , pady= 1, columnspan=2, sticky=(W))
30 ttk.Label(fSequence, text="Output" ).grid(column= 0, row=5, padx= 1 , pady= 1, columnspan=2, sticky=(W,E))
31 ttk.Checkbutton(fSequence, text=" ", variable=SeqOut6Var, onvalue='1', offvalue='0').grid(column=2, row=5, padx=0, pady=1, sticky=(W))
32 ttk.Checkbutton(fSequence, text=" ", variable=SeqOut5Var, onvalue='1', offvalue='0').grid(column=3, row=5, padx=0, pady=1, sticky=(W))
33 ttk.Checkbutton(fSequence, text=" ", variable=SeqOut4Var, onvalue='1', offvalue='0').grid(column=4, row=5, padx=0, pady=1, sticky=(W))
34 ttk.Checkbutton(fSequence, text=" ", variable=SeqOut3Var, onvalue='1', offvalue='0').grid(column=5, row=5, padx=0, pady=1, sticky=(W))
35 ttk.Checkbutton(fSequence, text=" ", variable=SeqOut2Var, onvalue='1', offvalue='0').grid(column=6, row=5, padx=0, pady=1, sticky=(W))
36 ttk.Checkbutton(fSequence, text=" ", variable=SeqOut1Var, onvalue='1', offvalue='0').grid(column=7, row=5, padx=0, pady=1, columnspan=2, sticky=(W))
39 ttk.Label(fSequence, text="Sequence -100" , justify='center').grid(column= 0, row=6, padx= 1 , pady= 1, columnspan=7, sticky=(W))
40 ttk.Label(fSequence, text="Sequence 0" , justify='center').grid(column= 7, row=6, padx= 1 , pady= 1, columnspan=7, sticky=(W,E))
41 ttk.Label(fSequence, text="Sequence 100" , justify='center').grid(column= 14, row=6, padx= 1 , pady= 1, columnspan=7, sticky=(W,E))
42 ttk.Label(fSequence, text="Sequence LOW" , justify='center').grid(column= 21, row=6, padx= 1 , pady= 1, columnspan=7, sticky=(W,E))
43 for x in range(0,4):
44 ttk.Label(fSequence, text="Time" ).grid(column= 0+(7*x), row=7, padx= 1 , pady= 1, sticky=(W))
45 ttk.Label(fSequence, text="D13" ).grid(column= 1+(7*x), row=7, padx= 0 , pady= 1, sticky=(W))
46 ttk.Label(fSequence, text="D12" ).grid(column= 2+(7*x), row=7, padx= 0 , pady= 1, sticky=(W))
47 ttk.Label(fSequence, text="D11" ).grid(column= 3+(7*x), row=7, padx= 0 , pady= 1, sticky=(W))
48 ttk.Label(fSequence, text="D10" ).grid(column= 4+(7*x), row=7, padx= 0 , pady= 1, sticky=(W))
49 ttk.Label(fSequence, text="D09" ).grid(column= 5+(7*x), row=7, padx= 0 , pady= 1, sticky=(W))
50 ttk.Label(fSequence, text="D08" ).grid(column= 6+(7*x), row=7, padx= 0 , pady= 1, sticky=(W))
52 for y in range(0,25):
53 for x in range(0,4):
54 ttk.Entry(fSequence, textvariable=SeqTVar[y*4+x] , width='5', justify='right').grid(column=0+(7*x), row=8+y, padx=10, sticky=(E))
55 ttk.Checkbutton(fSequence, variable=SeqB5Var[y*4+x], onvalue='1', offvalue='0').grid(column=1+(7*x), row=8+y, padx=0, pady=1, sticky=(E))
56 ttk.Checkbutton(fSequence, variable=SeqB4Var[y*4+x], onvalue='1', offvalue='0').grid(column=2+(7*x), row=8+y, padx=0, pady=1, sticky=(E))
57 ttk.Checkbutton(fSequence, variable=SeqB3Var[y*4+x], onvalue='1', offvalue='0').grid(column=3+(7*x), row=8+y, padx=0, pady=1, sticky=(E))
58 ttk.Checkbutton(fSequence, variable=SeqB2Var[y*4+x], onvalue='1', offvalue='0').grid(column=4+(7*x), row=8+y, padx=0, pady=1, sticky=(E))
59 ttk.Checkbutton(fSequence, variable=SeqB1Var[y*4+x], onvalue='1', offvalue='0').grid(column=5+(7*x), row=8+y, padx=0, pady=1, sticky=(E))
60 ttk.Checkbutton(fSequence, variable=SeqB0Var[y*4+x], onvalue='1', offvalue='0').grid(column=6+(7*x), row=8+y, padx=0, pady=1, sticky=(E))
62 ttk.Label(fSequence, text="Min Volt" ).grid(column= 0, row=34, padx= 1 , pady= 1, columnspan=2, sticky=(W))
63 ttk.Entry(fSequence, textvariable=SeqMinVoltVar , width='15', justify='right').grid(column=2 , row=34, columnspan=6, sticky=(E))
64 ttk.Label(fSequence, text="Min Cell" ).grid(column= 0, row=35, padx= 1 , pady= 1, columnspan=2, sticky=(W))
65 ttk.Entry(fSequence, textvariable=SeqMinCellVar , width='15', justify='right').grid(column=2 , row=35, columnspan=6, sticky=(E))